export const responseDataHandler = (response) => {
    const { data } = response;
    //假设后端返回的数据格式为 { code: 200, error: '成功', data: {...} }
    if (data && data.code === 200) {
        return data.data; //返回实际数据
    } else {
        //处理业务错误
        const error = new Error(data.error || '接口返回错误');
        error.code = data.code;
        return Promise.reject(error);
    }
}